package com.samh.openrower2.util;

import com.samh.openrower2.SpeedSensor;

public class SpeedHandler {
	
	public String convertSpeedToSplit(float speed) {
		
		int mins = 0;
		int secs = 00;
		
		if(speed==0 | speed < SpeedSensor.MIN_SPEED) {
			return "0:00";
		}
		 
		int secsFor500 = Math.round(500 / speed);
		
		mins = (int) Math.floor(secsFor500 / 60);
			
		secs = (int) secsFor500 - (mins * 60);
		
		return Long.toString(mins)+":"+ String.format("%02d", secs);
		
	}

}
